<!DOCTYPE html>
<html>
  <head>
    <title>Benchmarks</title>

    <!-- This tag improves the experience on mobile browsers. -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0,
        maximum-scale=1.0, user-scalable=0">

    <!-- These tags improve web apps on ios. -->
    <meta name="apple-mobile-web-app-capable" content="yes">
  </head>
  <body>
    <script type="text/javascript">
      function getQueryVariable(variable) {
        var query = window.location.search.substring(1);
        var vars = query.split('&');
        for (var i = 0; i < vars.length; i++) {
            var pair = vars[i].split('=');
            if (pair[0] == variable) {
                return unescape(pair[1]);
            }
        }
        return null;
      }

      console.log('Checking for native dart support');
      var script = document.createElement('script');
      if(getQueryVariable('native') && document.implementation.hasFeature('dart')) {
        // Browser has the goods, so kick it in to dart gear.
        console.log('Dart supported.');
        script.setAttribute('type', 'application/dart');
        script.setAttribute('src', 'benchmarks/BenchmarkRunner.dart');
      } else {
        // If browser doesn't support dart, redirect to js version.
        console.log('JS fallback.');
        script.setAttribute('src', 'js/benchmarks/BenchmarkRunner.dart.js');
      }
      document.body.appendChild(script);
    </script>
  </body>
</html>


